package com.hnas.eCard.dao;

import java.util.List;

import com.hnas.account.orm.Account;
import com.hnas.core.dao.BaseDao;
import com.hnas.eCard.orm.CardTrail;
import com.hnas.eCard.orm.ECardShareCode;
import com.hnas.eCard.service.dto.DTOSaleCardOrderDetail;

public interface CardTrailDAO extends BaseDao<CardTrail> {

	/**
	 * 通过电子卡状态分页查询电子卡信息
	 * @param searchStatus
	 * @param pageNo
	 * @param pageSize
	 * @return List<AccECard>
	 */
	List<CardTrail> findCardTrailByStatus(String accId ,String phoneNo, String searchStatus, Integer pageNo, Integer pageSize) throws Exception;
	
	/**
	 * 通过电子卡状态查询电子卡
	 * @param accId
	 * @param phoneNo
	 * @return
	 */
	List<CardTrail> findCardsByStatus(String accId ,String phoneNo,String status);
	
	CardTrail saveOrUpdate(CardTrail dto) throws Exception;
	
	/**
	 * 通过sql查询
	 * @param sql
	 * @return
	 */
	List<CardTrail> searchCardTrailSql(CardTrail vo);
	
	List<CardTrail> findCardTrailsByCardNoAndSomeStatus(String cardNo, String someStatus, String isDeleted);
	
	/**
	 * 取消赠送电子卡
	 * @Title: cancelGiveUpdate  
	 * @Description:  
	 * @param id 电子卡账户绑定记录id
	 * @param id2  电子卡轨迹id
	 * @throws
	 */
	void cancelGiveUpdate(String id, String id2);

	/**
	 * @param accId 
	 * 领取电子卡
	 * @Title: receiveECardUpdate  
	 * @Description:  
	 * @param id 电子卡账户绑定记录id
	 * @param id2  电子卡轨迹id
	 * @param receiveAccId 领取人id
	 * @throws
	 */
	void receiveECardUpdate(String id, String id2, String receiveAccId);
	/**
	 * 拒绝领取电子卡
	 * @Title: receiveECardUpdate  
	 * @Description:  
	 * @param id 电子卡账户绑定记录id
	 * @param id2  电子卡轨迹id
	 * @param receiveAccId 领取人id
	 * @throws
	 */
	void refuseECardUpdate(String id, String id2, String receiveAccId);

	List<CardTrail> listByCardAndDate(String cardNo, String date);

	List<CardTrail> listByCards(String sendAccId, String sendPhoneNo, String receivePhoneNo, String changeString);

	int batchSave(String sendAccId, DTOSaleCardOrderDetail orderDetailDto);

	void receiveSaleForOtherECard(String accId, CardTrail cardTrail);

	void shareReceiveECard(Account account, CardTrail cardTrail);

	List<CardTrail> findCardTrailsByCardNo(String cardNo);

	CardTrail findByShareCode(String shareCode);
}
